package day03;

import java.util.LinkedList;
import java.util.Queue;

public class QueueDemo {
    public static void main(String[] args) {
        Queue<String> queue = new LinkedList<>();
//        String str = queue.remove();//抛出异常
        String str = queue.poll();//返回null，获取并删除
//        String str = queue.peek();//返回null，获取不删除
        System.out.println(queue.offer("tom"));//入队成功返回true

        System.out.println(str);
    }
}
